$(function () {
    console.log(window.location.href.split('?')[1]);
    $.ajax({
        url: BigNews.index_get_comment,
        type: 'get',
        dataType: 'json',
        data: {
            articleId: window.location.href.split('?')[1]
        },
        success: function (backData) {
            console.log(backData);
        }
    })
    $.ajax({
        url: BigNews.index_article,
        type: 'get',
        dataType: 'json',
        data: {
            id: window.location.href.split('?')[1]
        },
        success: function (backData) {
            console.log(backData);
            $('.article_title').text(backData.data.title)
            $('.article_info').text(`${backData.data.author} 发布于 ${backData.data.date} 07:08:46 分类: ${backData.data.category} 阅读:
            (${backData.data.read}) 评论: (${backData.data.comments}) `)
            $('.article_con').html(`<p>${backData.data.content}</p>`)
            // console.log($('.article_links').children().eq(0));
            if (backData.data.prev) {
                $('.article_links').children().eq(0).attr(`href','./article.html?${backData.data.prev.id}`)
                $('.article_links').children().eq(0).text(backData.data.prev.title)
            }
            if (backData.data.next) {
                $('.article_links').children().eq(2).attr(`href','./article.html?${backData.data.next.id}`)
                $('.article_links').children().eq(2).text(backData.data.next.title)
            }
        }
    });
})